package com.mashibing.constraints;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = DateTimeCheckValidator.class)
public @interface DataTimeCheck {

    String judge() default IS_AFTER;

    String pattern() default "yyyy-MM-dd HH:mm:ss";

    String message() default "请输入正确的时间类型";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    String IS_AFTER = "isAfter";
    String IS_BEFORE = "isBefore";
}
